<?php
class Core_Controller_Plugin_Multilang extends Zend_Controller_Plugin_Abstract {
	public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request) {
		
		// TODO: remove to own controller plugin
		Zend_Registry::set ( 'IsHome', $request->getActionName () == 'index' && $request->getControllerName () == 'index' );
		
		$lang = $request->getParam ( 'lang' );
		Zend_Registry::set ( 'lang', $lang );
		$config = Zend_Registry::get ( 'config' );
		Zend_Registry::set ( 'Zend_Translate', new Zend_Translate ( array ("adapter" => "gettext", "content" => $config->L10->lang->$lang, "locale" => $lang ) ) );
	}
}